/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package models;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Table;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;

/**
 *
 * @author Michel
 */
@Entity
@Table(name = "Lesson")
public class Lesson implements Serializable {

    @Id
    @GeneratedValue
    @Column(name = "Lesson_id")
    private long id;
    @Column(name = "Lesson_name")
    private String name;
    @Column(name = "Lesson_description")
    private String Description;
    @ManyToOne
    private Course course;
    @Column(name = "added_on")
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date date;
    private boolean freeLesson = false;
    private boolean liveLesson = false;

    public Lesson() {
    }

    public Lesson(long id, String name, String Description, Course course, boolean freeLesson, boolean liveLesson) {
        this.setId(id);
        this.setName(name);
        this.setDescription(Description);
        this.setCourse(course);
        this.setDate();
        this.setFreeLesson(freeLesson);
        this.setLiveLesson(liveLesson);
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return Description;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    public Course getCourse() {
        return course;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    /**
     * @return the date
     */
    public Date getDate() {
        return date;
    }

    /**
     * @param date the date to set
     */
    public void setDate() {
        Date date = new Date();
        this.date = date;
    }

    /**
     * @return the freeLesson
     */
    public boolean isFreeLesson() {
        return freeLesson;
    }

    /**
     * @param freeLesson the freeLesson to set
     */
    public void setFreeLesson(boolean freeLesson) {
        this.freeLesson = freeLesson;
    }

    /**
     * @return the liveLesson
     */
    public boolean isLiveLesson() {
        return liveLesson;
    }

    /**
     * @param liveLesson the liveLesson to set
     */
    public void setLiveLesson(boolean liveLesson) {
        this.liveLesson = liveLesson;
    }
}
